package com.jy.datapipeline.export.controller;

import com.jy.datapipeline.export.service.ExpTaskExecuteDetailLogService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping(value = "/exptask/execute/detail/")
public class ExpTaskExecuteDetailLogController {
    @Autowired
    private ExpTaskExecuteDetailLogService expTaskExecuteDetailLogService;

    @RequestMapping( value = "findByList",method = RequestMethod.GET)
    @ResponseBody
    public Object findByList(
        @RequestParam(value = "taskId",required = true) String taskId,
        @RequestParam(value = "taskExecuteLog",required = true) String taskExecuteLog,
        @RequestParam(value = "ruleTbl",required = true) String ruleTbl,
        @RequestParam(value = "expStatus",required = true) String expStatus,
        @RequestParam(value = "iDisplayStart",required = true) Integer iDisplayStart,
        @RequestParam(value = "iDisplayLength",required = true) Integer iDisplayLength
    ){
        Map<String, Object> map=new HashMap<>();
        List<Map<String,Object>> list=this.expTaskExecuteDetailLogService.findExpTaskExecuteDetailByList(taskId,taskExecuteLog,ruleTbl,expStatus,iDisplayStart,iDisplayLength);
        int count=this.expTaskExecuteDetailLogService.findExpTaskExecuteDetailByCount(taskId,taskExecuteLog,ruleTbl,expStatus);
        map.put("datalist",list);
        map.put("count", count);
        return map;
    }



}
